
    function c(type, sel) {
      $("#ctype").val(type);
      $("#sels").text($(sel).text())
    }

    $(function () {
      $("#testcaseexcel").click(function () {
        $("#content").val("name\tpayment\turl\tasdf\naaa中文测试\t999\thttp://www.baidu.com\tasdf\nbbb\t888\thttp://www.baidu.com\tasdf\nccc中文测试\t777\thttp://www.baidu.com\tasdf\nddd\t666\thttp://www.baidu.com\tasdf\neee中文测试\t555\thttp://www.baidu.com\tasdf\nfff\t444\thttp://www.baidu.com\tasdf")
      });
      var fgf = /\t/;
      function ctyperow2() {
        var nob = $("#nob").is(":checked");
        fgf = $("#fgfstr").val() || fgf;
        var ctype = $("#ctype").val();
        var content = $("#content").val();
        var contentArr = content.split("\n");
        var start = "[\n";
        var strArr = [];
        for (var i = 0; i < contentArr.length; i++) {
          var cArr = contentArr[i].split(fgf);
          if (i == 0) {
            if (ctype == "0") {
              strArr = cArr
            } else {
              start += "[";
              for (var j = 0; j < cArr.length; j++) {
                start += "\"" + cArr[j] + "\"";
                if (j < cArr.length - 1) {
                  start += ","
                }
              };
              start += "],\n"
            }
          } else {
            if (cArr.length == 0) {
              continue
            };
            if (cArr.length == 1) {
              cArr[0] == "";
              continue
            };
            start += ctype == "0" ? "{" : "[";
            for (var j = 0; j < cArr.length; j++) {
              var jArr = cArr[j];
              if (ctype == "0") {
                start += "\"" + strArr[j] + "\":";
                if (!nob && isNumberOrBoolean(jArr)) {
                  start += "" + jArr
                } else {
                  jArr = jArr.replace(/\"/g, "\\\"");
                  start += "\"" + jArr + "\""
                }
              } else {
                if (!nob && isNumberOrBoolean(jArr)) {
                  start += "" + jArr
                } else {
                  jArr = jArr.replace(/\"/g, "\\\"");
                  start += "\"" + jArr + "\""
                }
              };
              if (j < cArr.length - 1) {
                start += ","
              }
            };
            start += ctype == "0" ? "}" : "]";
            if (i < contentArr.length - 1) {
              start += ",\n"
            }
          }
        };
        start += "\n]";
        $jsonTextArea.val(start)
      }
      $("#content").bind("change1", function () {
        var ctype = $("#ctype").val();
        var content = "";
        if (ctype == "0") {
          content = ctype0()
        }
      });
      $("#changebtn2").click(function () {
        ctyperow2()
      })
    });